<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <link rel="StyleSheet" href="css/style.css" type="text/css">
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="content-type">
  <meta name="verify-v1"
 content="sRQSq4VA5FRMhwzFB4U3I9AtgLMtIWTdpVVO6jg1az4=">
  <title>atomserver Batching</title>
  <script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  </script>
  <script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4603527-2");
pageTracker._initData();
pageTracker._trackPageview();
  </script>
</head>
<body class="maincontent">
<h1><img style="width: 75px; height: 75px;" src="images/atom-logo.gif"
 alt="logo">&nbsp;&nbsp;
<span style="font-weight: bold;"></span>AtomServer, Batching Details </h1>
<span style="font-style: italic;">Chris Berry,
Bryon Jacob.
Updated&nbsp;&nbsp; 08/15/08 </span><br>
<div class="content"><br>
This
document describes some specific details about batch processing in
AtomServer. Batch processing gives you the ability to execute multiple
operations in one request, rather than having to submit each operation
individually.<br>
<br>
For a further, detailed description of the actual protocol, either<br>
<ul>
  <li>See <a href="http://www.atomenabled.org/developers/syndication/">the
Atom Publishing Protocol Reference</a> for further information about
the
elements of the feed itself. Note that we do not exhaustingly document
this
information ourselves,&nbsp; because we are using Atom entirely as
dictated
by the standard.</li>
  <li>See <a href="protocol_basics.html">the AtomServer Protocol
Basics document </a>for general information about communicating with
the AtomServer service.<br>
  </li>
</ul>
<h2>Contents</h2>
<ul>
  <li><a href="#info">General Information</a><br>
  </li>
  <li><a href="#submit">Submitting a batch request</a></li>
  <li><a href="#writing">Writing a batch operations feed</a></li>
  <ul>
    <li><a href="#insert">Insert operations</a><br>
    </li>
    <li><a href="#update">Update operations</a></li>
    <li><a href="#delete">Delete operations</a></li>
  </ul>
  <li><a href="#status-codes">Handling status codes</a></li>
  <li><a href="#example">Example batch operations and status feed</a> </li>
  <li><a href="#resources">Additional Resources</a><br>
  </li>
</ul>
<hr style="width: 100%; height: 2px;">
<h2><a name="info"></a>General Information<br>
</h2>
Using a AtomServer batch feed, you can collect multiple insert, update,
and
delete operations, and then submit and execute them all at once. Unlike
GData, we do <span style="font-weight: bold;">not</span> allow you to
batch queries as well. Currently, we do not see a reasonable use case
for batching queries, since feeds essentially provide this
functionality already.&nbsp;
<p>For example, the following feed includes three operations (a delete
and two updates -- one an insert and one an update)<br>
</p>
<div style="margin-left: 40px;">
<div id="codebox">&lt;feed xmlns="http://www.w3.org/2005/Atom"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;entry
xmlns:ha="http://atomserver.org/namespaces/atomserver/1.0/"&gt;<br>
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;asbatch:operation type="update"/&gt;</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;link href="/myserver/v1/widgets/acme/92347.en.xml/0" rel="edit"/&gt;</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
.... what to update ....<br>
&nbsp;&nbsp;
&nbsp; &lt;/entry&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;entry
xmlns:ha="http://atomserver.org/namespaces/atomserver/1.0/"&gt;<br>
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;asbatch:operation type="delete"/&gt;</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;link href="/myserver/v1/widgets/acme/92345.en.xml/1" rel="edit"/&gt;</span><br
 style="font-weight: bold;">
&nbsp;&nbsp;&nbsp;&nbsp; &lt;/entry&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;entry
xmlns:ha="http://atomserver.org/namespaces/atomserver/1.0/"&gt;<br>
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;asbatch:operation type="update"/&gt;</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;link href="/myserver/v1/widgets/acme/92348.en.xml" rel="edit"/&gt;</span><br
 style="font-weight: bold;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .... what to insert
....<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;/entry&gt;<br>
&lt;/feed&gt;<br>
</div>
<span style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span></div>
<p>The service will perform as many of the requested changes as
possible and return status information that you can use to evaluate the
success or failure of each operation.</p>
<p>The service attempts to execute each of the operations within a
batch, even if some of the operations included in the batch do not
succeed. Note that this means that, internal to AtomServer, <span
 style="font-style: italic;">the operations are batched to the database.</span>
Thus, batch processing in AtomServer can very much improve overall
performance, and is <span style="font-style: italic;">strongly
recommended </span>if you need to publish many entries at once.<br>
</p>
<p>There are several points to notice when looking at the example above;<br>
</p>
<ul>
  <li>Batches are submitted and returned as a <span
 style="font-family: monospace;">&lt;feed&gt;. </span>This means that
you can use mostly standard Atom syntax
(&lt;feed&gt;, &lt;entry&gt;, etc) when composing a batch operations
request.<br>
  </li>
  <li>You <span style="font-weight: bold;">must</span> provide a
special XML element&nbsp;<span style="font-family: monospace;">&lt;asbatch:operation
type="insert|update|delete"/&gt;</span> for each <span
 style="font-family: monospace;">&lt;entry&gt;</span> that you submit
for batch processing. This may be either per Entry or per Batch.<br>
  </li>
  <li>You <span style="font-weight: bold;">must</span> provide the
atomserver asbatch namespace on the <span
 style="font-family: monospace;">&lt;feed&gt;</span>
element (i.e <span style="font-family: monospace;">&lt;feed </span>xmlns:asbatch="http://atomserver.org/namespaces/1.0/batch"<span
 style="font-family: monospace;">&gt; </span>)</li>
  <li>You <span style="font-weight: bold;">must</span> provide the
atomserver namespace on the <span style="font-family: monospace;">&lt;entry&gt;</span>
element (i.e <span style="font-family: monospace;">&lt;entry xmlns:as="</span><span
 style="font-family: monospace;">http://atomserver.org/namespaces/1.0/</span><span
 style="font-family: monospace;">"&gt; </span>)</li>
  <li>You <span style="font-weight: bold;">must</span> provide a "edit
link" to identify which entry to operate on. (e.g. <span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;">&lt;link
href="/myserver/v1/widgets/acme/92348.en.xml/2" rel="edit"/&gt;</span>)
This is consistent
with all other AtomServer usage. The edit link is the only guaranteed
way
to edit an entry in AtomServer. This link should contain the correct
revision number to satisfy optimistic concurrency expectations.</li>
</ul>
Another important, but subtle point is that AtomServer allows "lazy
inserts".
This is because AtomServer, in keeping with REST principles, allows you
to <span style="font-family: monospace;">PUT</span> an entry for
either insert
or update to the same URL, and AtomServer determines on-the-fly which
operation is required. So, as expected, this behavior is reflected in
the batch processing API, and thus, <span
 style="font-family: monospace;">&lt;asbatch:operation
type="update"/&gt; </span>may be used for either an insert or an
update, provided you supply an Entry URL in the "edit link" (e.g. <span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;">&lt;link
href="/myserver/v1/widgets/acme/92348.en.xml/2" rel="edit"/&gt;</span>).
<br>
<br>
AtomServer also allows for typical RESTful <span
 style="font-family: monospace;">POST </span>operations, which are, by
definition, <span style="font-family: monospace;">insert</span>
operations. Again, you provide an "edit link", but, in this case, you
will provide a "Feed URL. (e.g <span style="font-family: monospace;"></span><span
 style="font-family: monospace;">&lt;link
href="/myserver/v1/widgets/acme" rel="edit"/&gt;</span>).<br>
<br>
Batch Entries are returned in the same order they were provided. And
further Response details are supplied in the Entry, including&nbsp;
HTTP status code (200, 201, 400, 409, etc.) and what operation actually
occured (<span style="font-family: monospace;">insert</span>, <span
 style="font-family: monospace;">update</span>, <span
 style="font-family: monospace;">delete</span>, or <span
 style="font-family: monospace;">error</span>) <br>
<hr style="width: 100%; height: 2px;">
<h2><a name="submit"></a>Submitting a batch request</h2>
<p>A
batch request should be sent as an HTTP <big><big><span
 style="font-family: monospace; font-weight: bold;">PUT</span></big></big>
to a AtomServer batch URL, which is simply the Feed URL with "/$batch"
appended to it. So, for example, if you wanted to send a set of batch
operations to the "<span style="font-family: monospace;">widgets/acme</span>"
feed, then you would <span style="font-family: monospace;">PUT</span>
to the following URL;<br>
</p>
<div style="margin-left: 40px;">
<div id="codebox"><span style="font-family: monospace;"><span
 style="font-weight: bold;">PUT
/myserver/v1/widgets/$batch</span><br>
</span> </div>
<span style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span></div>
<p><br>
</p>
<hr style="width: 100%; height: 2px;">
<h2><a name="writing"></a>Writing a batch operations feed</h2>
<p>A batch operations feed contains a list of entries to insert,
update, or delete. Each operation is defined by a <code>&lt;asbatch:operation
type="insert|update|delete"/&gt;</code> element. How these these
operations work directly reflects <a href="protocol_basics.html">how
AtomServer works for <span style="font-family: monospace;">PUT</span>,
<span style="font-family: monospace;">POST</span>, and <span
 style="font-family: monospace;">DELETE</span> of individual Entries</a>.<br>
</p>
<ul>
  <li><span style="font-family: monospace; font-weight: bold;">PUT</span><span
 style="font-weight: bold;">.</span>&nbsp;
In AtomServer you can submit both inserts and updates using a HTTP<span
 style="font-family: monospace;"> PUT </span>(a, so called, Lazy Insert<span
 style="font-family: monospace;">),</span> and
this
behavior is, of course, reflected in the batch processing API. For
either <span style="font-family: monospace;">PUT</span> operation - an
update or insert - you <span style="font-weight: bold;">must</span>
submit an "edit link" that represents an Entry URL. (e.g. <span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;">&lt;link
href="/myserver/v1/widgets/acme/92348.en.xml/2" rel="edit"/&gt;</span>).
  </li>
  <li><span style="font-family: monospace; font-weight: bold;">POST.</span>
You can also request a batch <span style="font-family: monospace;">insert</span>
operation that reflects a RESTful HTTP POST, and in this case the Entry
Id is generated by AtomServer. Here you <span
 style="font-weight: bold;">must</span> provide an "edit link" that
represents a "Feed URL. (e.g <span style="font-family: monospace;"></span><span
 style="font-family: monospace;">&lt;link
href="/myserver/v1/widgets/acme" rel="edit"/&gt;</span>).<br>
  </li>
  <li><span style="font-family: monospace; font-weight: bold;">DELETE.</span>
To request a batch <span style="font-family: monospace;">delete</span>
operation that reflects a HTTP <span style="font-family: monospace;">DELETE</span>,
you <span style="font-weight: bold;">must</span> submit an "edit link"
that represents an Entry URL. (e.g. <span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;">&lt;link
href="/myserver/v1/widgets/acme/92348.en.xml/2" rel="edit"/&gt;</span>).
  </li>
</ul>
<p>The <span style="font-family: monospace;">operation</span> element
may be a direct child of a <code>&lt;feed&gt;</code>
element, a direct child of any of the Entries in the Feed, or both.
When included in an Entry, it specifies the operation to
execute for that specific Entry. When included in the Feed, this
element specifies the default operation to execute on any Entries that
do not have a <code>&lt;asbatch:operation/&gt;</code> element.</p>
<p>When neither the Entry nor the Feed specifies an operation, <span
 style="font-style: italic;">the
default operation is </span><code style="font-style: italic;">update</code>.<br>
</p>
<p>Applications may <span style="font-weight: bold;">not</span> apply
multiple operations to the same entry
in a single batch feed. The results would be indeterminate if you
specified multiple operations for the same entry, therefore, an
Exception is thrown and you will recieve a 400 HTTP response code in
the <code>&lt;asbatch:status/&gt;</code> element.<br>
</p>
<p>Operations are NOT necessarily performed in the order listed in the
feed - operations are partitioned into two groups - updates
and deletes - and each group is executed in a single batch operation to
the database.&nbsp; For this reason, <span style="font-style: italic;">you
may <span style="font-weight: bold;">not</span> submit multiple
operations
on the same entry in the same batch</span>, and doing so will produce
an error for all duplicates. The first Entry in a duplicate set will be
processed, and all others will result in errors. <br>
</p>
<p>It is important to note that AtomServer will attempt to process all
Entries in the batch, and will return all Entries in the same order it
received them. If any errors occured, those Entries will be returned
along with all others, and will simply be flagged as errors. The status
element will indicate the error that occured and a short description of
the reason (e.g. <span style="font-family: monospace;">&lt;asbatch:status
code="400" reason="Bad Request::....." /&gt;</span> ) <br>
</p>
<p>By default, the
number of entries in the XML batch operations feed that you send to the
server may not exceed 15 for "full entries" and 100 for "link entries"
(look <a href="protocol_reference.html#entry-type">here</a> for
definitions of these terms).&nbsp; This restriction allows AtomServer
to
protect itself from excessive feeds. Note, the numbers shown here are
the default values, and a AtomServer Workspace can be configured with
alternate values.<br>
</p>
<h3><a name="insert"></a>Insert operations</h3>
<p>An insert operation is denoted as follows:</p>
<div style="margin-left: 40px;">
<div style="font-weight: bold;" id="codebox"><code>&lt;asbatch:operation
type="insert"&gt;</code> </div>
<span style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span></div>
<p>In AtomServer, an
insert operation is equivalent to either PUTing or POSTing a new Entry.
Which of these occurs depends upon the "edit link" that is provided. If
an Entry URL is provided within the "edit link"; a PUT equivalent
occurs. And if a Feed URL is provided within the "edit link"; a POST
equivalent occurs. This exactly matches the behavior of AtomServer in
general.&nbsp; <br>
</p>
<p>When
the insert operation
succeeds, the entire Entry content is returned, with an updated
document id field. And you will receive a <code>&lt;asbatch:status
code="201"/&gt;</code> element.&nbsp;</p>
<p>Here is an example of a successful POST insert Request:
<br>
</p>
<div style="margin-left: 40px;">
<div id="codebox">&nbsp;&lt;feed xmlns="http://www.w3.org/2005/Atom"
xmlns:asbatch="http://atomserver.org/namespaces/1.0/batch"&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;entry
xmlns:ha="http://atomserver.org/namespaces/1.0/"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;content
type="application/xml"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property xmlns="http://schemas.atomserver.org/widgets/v1/rev0"
systemId="acme"
id="92348" inNetwork="false"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;contact&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&lt;contactId&gt;1638&lt;/contactId&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&lt;displayName&gt;Chris Berry&lt;/displayName&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&lt;hasEmail&gt;true&lt;/hasEmail&gt;<br>
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/contact&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/property&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/content&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
 style="font-weight: bold;">&lt;asbatch:operation
type="insert"/&gt;</span><br style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;link
href="/myserver/v1/widgets/acme" rel="edit"/&gt;</span><br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;/entry&gt;<br>
&lt;/feed&gt;<br>
</div>
<span style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span></div>
<p>Here is an example of a Response to a successful insert request: <br>
</p>
<div style="margin-left: 40px;">
<div id="codebox">&lt;?xml version='1.0' encoding='UTF-8'?&gt;<br>
&lt;feed xmlns="http://www.w3.org/2005/Atom" <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
xmlns:asbatch="http://atomserver.org/namespaces/1.0/batch"&gt;<br>
&nbsp;<span style="font-weight: bold;">&nbsp;&nbsp; &lt;asbatch:results
inserts="1" updates="0" deletes="0" errors="0" /&gt;&nbsp;&nbsp;&nbsp; </span><br
 style="font-weight: bold;">
&nbsp;&nbsp;&nbsp; &lt;entry
xmlns:as="http://atomserver.org/namespaces/1.0/"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;id&gt;/myserver/v1/widgets/acme/a371412926e0439983eda36651049dfa.en.xml&lt;/id&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;updated&gt;2007-11-15T17:09:19.000Z&lt;/updated&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;published&gt;2007-11-15T17:09:19.000Z&lt;/published&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;title
type="text"&gt;Entry: acme 92348.en&lt;/title&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;author&gt;&lt;name&gt;AtomServer Atom
Service&lt;/name&gt;&lt;/author&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;link
href="/myserver/v1/widgets/acme/a371412926e0439983eda36651049dfa.en.xml"
rel="self"/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;link
href="/myserver/v1/widgets/acme/a371412926e0439983eda36651049dfa.en.xml/1"
rel="edit"/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;content
type="application/xml"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property xmlns="http://schemas.atomserver.org/widgets/v1/rev0"
systemId="acme"
id="a371412926e0439983eda36651049dfa" inNetwork="false"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;contact&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&lt;contactId&gt;1638&lt;/contactId&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&lt;displayName&gt;Chris Berry&lt;/displayName&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&lt;hasEmail&gt;true&lt;/hasEmail&gt;<br>
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/contact&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/property&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/content&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;category/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
 style="font-weight: bold;">&lt;asbatch:operation
type="insert"/&gt;</span><br style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;asbatch:status
code="201" reason="OK"/&gt;</span><br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;/entry&gt;<br>
&lt;/feed&gt;<br>
<code></code> </div>
<span style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span></div>
<p>Note that the <span style="font-family: monospace;">&lt;asbatch:operation&gt;</span>
is returned with <span style="font-family: monospace;">type="insert"</span>
when an insert occurs.<br>
</p>
<h3><a name="update"></a>Update operations</h3>
<p>An update operation is denoted as follows:</p>
<div style="margin-left: 40px;">
<div style="font-weight: bold;" id="codebox"><code>&lt;asbatch:operation
type="update"&gt;</code> </div>
<span style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span></div>
<p>In AtomServer, a PUT operation can result in <span
 style="font-style: italic;">either</span> an
insert and an update operation, and not surprisingly AtomServer allows
this same behavior in batch operations. <br>
</p>
<p>When
the update operation
succeeds, the entire entry content is returned, with an updated
document id field. If an insert occurred, you will receive a <code>&lt;asbatch:status
code="201"/&gt;</code> element. And if an update occurred, you will
receive a <code>&lt;asbatch:status code="200"/&gt;</code> element.</p>
<p>Here is an example of a successful insert request:<br>
</p>
<div style="margin-left: 40px;">
<div id="codebox">&lt;feed xmlns="http://www.w3.org/2005/Atom"
xmlns:asbatch="http://atomserver.org/namespaces/1.0/batch"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;entry
xmlns:ha="http://atomserver.org/namespaces/atomserver/1.0/"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;id&gt;/myserver/v1/widgets/acme/92348.en.xml&lt;/id&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;content
type="application/xml"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property xmlns="http://schemas.atomserver.org/widgets/v1/rev0"
systemId="acme"
id="92348" inNetwork="false"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;contact&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&lt;contactId&gt;1638&lt;/contactId&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&lt;displayName&gt;Chris Berry&lt;/displayName&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&lt;hasEmail&gt;true&lt;/hasEmail&gt;<br>
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/contact&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/property&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/content&gt;<br>
&nbsp;<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;asbatch:operation
type="update"/&gt;</span><br style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;link
href="/myserver/v1/widgets/acme/92348.en.xml/0" rel="edit"/&gt;</span><br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;/entry&gt;<br>
&lt;/feed&gt;<br>
</div>
<span style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span></div>
<p>Here is an example of a response to a successful update request: <br>
</p>
<div style="margin-left: 40px;">
<div id="codebox">&lt;feed xmlns="http://www.w3.org/2005/Atom" <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
xmlns:asbatch="http://atomserver.org/namespaces/1.0/batch"&gt;<br>
&nbsp;<span style="font-weight: bold;"> &nbsp;&nbsp;
&lt;asbatch:results inserts="1" updates="0" deletes="0" errors="0"
/&gt;&nbsp;&nbsp;&nbsp; </span><br style="font-weight: bold;">
&nbsp;&nbsp;&nbsp;&nbsp; &lt;entry
xmlns:ha="http://atomserver.org/namespaces/atomserver/1.0/"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;id&gt;/myserver/v1/widgets/acme/92348.en.xml&lt;/id&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;updated&gt;2007-11-15T17:09:19.000Z&lt;/updated&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;published&gt;2007-11-15T17:09:19.000Z&lt;/published&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;title
type="text"&gt;Entry: acme 92348.en&lt;/title&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;author&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;name&gt;AtomServer Atom Service&lt;/name&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/author&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;link
href="/myserver/v1/widgets/acme/92348.en.xml" rel="self"/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;link
href="/myserver/v1/widgets/acme/92348.en.xml/1" rel="edit"/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;content
type="application/xml"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property xmlns="http://schemas.atomserver.org/widgets/v1/rev0"
systemId="acme"
id="92348" inNetwork="false"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;contact&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&lt;contactId&gt;1638&lt;/contactId&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&lt;displayName&gt;Chris Berry&lt;/displayName&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&lt;hasEmail&gt;true&lt;/hasEmail&gt;<br>
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/contact&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/property&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/content&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;category/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
 style="font-weight: bold;">&lt;asbatch:operation
type="insert"/&gt;</span><br style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;asbatch:status
code="201" reason="OK"/&gt;</span><br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;/entry&gt;<br>
&lt;/feed&gt;<code></code> </div>
<span style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span></div>
<p>Note that the <span style="font-family: monospace;">&lt;asbatch:operation&gt;</span>
is returned with <span style="font-family: monospace;">type="insert"</span>
when an insert occurs, and <span style="font-family: monospace;">type="update"
</span>when an update occurs</p>
<h3><a name="delete"></a>Delete operations</h3>
<div style="margin-left: 40px;">
<div style="font-weight: bold;" id="codebox"><code>&lt;asbatch:operation
type="delete"&gt;</code> </div>
<span style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span></div>
<p>A delete operation is equivalent to executing a <code>DELETE</code>
on the URL referenced by by the entry's <code>&lt;next&gt;</code>
element. For a delete operation, you only need to send a valid &lt;link
... rel="next/&gt; to delete the entry. Any other information you
provide in elements that aren't in the <code>asbatch:</code> namespace
will be ignored. When the operation succeeds, a <code>&lt;batch:status
code="200"/&gt;</code> element will be returned.</p>
<p>Here is an example of a delete request: <br>
</p>
<div style="margin-left: 40px;">
<div id="codebox">&lt;feed xmlns="http://www.w3.org/2005/Atom"
xmlns:asbatch="http://atomserver.org/namespaces/1.0/batch"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;entry
xmlns:ha="http://atomserver.org/namespaces/atomserver/1.0/"&gt;<br>
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;asbatch:operation
type="delete"/&gt;</span><br style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;link
href="/myserver/v1/widgets/acme/92345.en.xml/1" rel="edit"/&gt;</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;</span>&nbsp;&nbsp;&nbsp;
&lt;/entry&gt;<br>
&lt;/feed&gt;<br>
<code></code> </div>
<span style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span></div>
<p>Here is an example of a successful response:</p>
<div style="margin-left: 40px;">
<div id="codebox">&lt;feed xmlns="http://www.w3.org/2005/Atom" <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
xmlns:asbatch="http://atomserver.org/namespaces/1.0/batch"&gt;<br>
&nbsp;<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;
&lt;asbatch:results inserts="0" updates="0" deletes="1" errors="0"
/&gt;&nbsp;&nbsp;&nbsp; </span><br style="font-weight: bold;">
&nbsp;&nbsp;&nbsp;&nbsp; &lt;entry
xmlns:ha="http://atomserver.org/namespaces/atomserver/1.0/"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;id&gt;/myserver/v1/widgets/acme/92345.en.xml&lt;/id&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;updated&gt;2007-11-15T17:09:19.000Z&lt;/updated&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;published&gt;2007-11-15T17:09:19.000Z&lt;/published&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;title
type="text"&gt;Entry: acme 92345.en&lt;/title&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;author&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;name&gt;AtomServer Atom Service&lt;/name&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/author&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;link
href="/myserver/v1/widgets/acme/92345.en.xml" rel="self"/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;link
href="/myserver/v1/widgets/acme/92345.en.xml/2" rel="edit"/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;content
type="application/xml"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;deletion xmlns="http://schemas.atomserver.org/myserver/v1/rev0"
collection="acme" id="92345" locale="en"<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
workspace="widgets"&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property xmlns="http://schemas.atomserver.org/widgets/v1/rev0"
systemId="acme"
id="92345" inNetwork="false"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
&nbsp; &nbsp;&nbsp; &lt;contact&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
&nbsp; &nbsp; &lt;contactId&gt;1638&lt;/contactId&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
&nbsp; &nbsp; &lt;displayName&gt;Chris Berry&lt;/displayName&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
&nbsp; &nbsp; &lt;hasEmail&gt;true&lt;/hasEmail&gt;<br>
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
&lt;/contact&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/property&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/deletion&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/content&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/content&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;category/&gt;<br>
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;asbatch:operation
type="delete"/&gt;</span><br style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;asbatch:status
code="200" reason="OK"/&gt;</span><br style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;</span>&nbsp;&nbsp;&nbsp;
&lt;/entry&gt;<code></code> </div>
<span style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span></div>
<br>
<span style="font-family: monospace;"></span>
<hr style="width: 100%; height: 2px;">
<h2><a name="status-codes"></a>Handling status codes</h2>
<p>Status codes are expressed by the following element:<span
 style="font-family: monospace;"></span><br>
</p>
<div style="margin-left: 40px;">
<div id="codebox"><code></code><span style="font-weight: bold;">&lt;asbatch:status
code="200|201|404|500|..." reason="reason" [content-type="type"]/&gt;</span>
</div>
<span style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span></div>
<p>Each entry in the response feed contains one <code>&lt;asbatch:status&gt;</code>
element. This element describes what happened while executing the
operation. It mimics the HTTP response that would have been sent if the
operation had been sent individually, rather than as part of a batch
feed.</p>
<p>You need to check the <code>&lt;asbatch:status&gt;</code> element
of each entry in the response to find out whether the associated
operation was successfully processed. The <code>code="n"</code>
attribute contains <a href="protocol_reference.html#http-status-codes">a
AtomServer
status code</a>.</p>
<h3>Status descriptions</h3>
<p>The <code>reason="reason"</code> attribute of the <code>&lt;asbatch:status&gt;</code>
element contains a more verbose explanation of the operation's status.</p>
<h3>Content type</h3>
<p>The <code>content-type="type"</code> attribute of the <code>&lt;asbatch:status&gt;</code>
element contains the MIME type of the data contained in the <code>&lt;batch:status&gt;</code>
element. This corresponds to the <code>Content-Type</code> header of
an HTTP status response. This attribute is optional.</p>
<p>When the content type is set, the body of the <code>&lt;asbatch:status&gt;</code>
element describes what went wrong while processing the entry.</p>
<hr style="width: 100%; height: 2px;">
<h2><a name="example"></a>Example batch operations and status feed</h2>
<p>Here is a batch operations feed that could be sent to the server.
This feed requests that the server delete two entries and modify two
new entries.</p>
<div style="margin-left: 40px;"><br>
<div id="codebox">
<pre>PUT   http://myserver.com/myserver/v1/widgets/acme/$batch<br></pre>
&lt;feed xmlns="http://www.w3.org/2005/Atom"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;entry
xmlns:ha="http://atomserver.org/namespaces/atomserver/1.0/"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;content
type="application/xml"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property xmlns="http://schemas.atomserver.org/widgets/v1/rev0"
systemId="acme"
id="92347" inNetwork="false"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;contact&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&lt;contactId&gt;1638&lt;/contactId&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&lt;displayName&gt;Chris Berry&lt;/displayName&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&lt;hasEmail&gt;true&lt;/hasEmail&gt;<br>
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/contact&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/property&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/content&gt;<br>
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;asbatch:operation
type="update"/&gt;</span><br style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;link
href="/myserver/v1/widgets/acme/92347.en.xml/1" rel="edit"/&gt;</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;</span>&nbsp;&nbsp;&nbsp;
&lt;/entry&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;entry
xmlns:ha="http://atomserver.org/namespaces/atomserver/1.0/"&gt;<br>
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;asbatch:operation
type="delete"/&gt;</span><br style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;link
href="/myserver/v1/widgets/acme/92345.en.xml/1" rel="edit"/&gt;</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;</span>&nbsp;&nbsp;&nbsp;
&lt;/entry&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;entry
xmlns:ha="http://atomserver.org/namespaces/atomserver/1.0/"&gt;<br>
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;asbatch:operation
type="delete"/&gt;</span><br style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;link
href="/myserver/v1/widgets/acme/23456.en.xml/5" rel="edit"/&gt;</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;</span>&nbsp;&nbsp;&nbsp;
&lt;/entry&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;entry
xmlns:ha="http://atomserver.org/namespaces/atomserver/1.0/"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;content
type="application/xml"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property xmlns="http://schemas.atomserver.org/widgets/v1/rev0"
systemId="acme"
id="92348" inNetwork="false"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;contact&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&lt;contactId&gt;1533&lt;/contactId&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&lt;displayName&gt;Bryon Jacob&lt;/displayName&gt;<br>
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/contact&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/property&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/content&gt;<br>
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;asbatch:operation
type="update"/&gt;</span><br style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;link
href="/myserver/v1/widgets/acme/92348.en.xml/0" rel="edit"/&gt;</span><br
 style="font-weight: bold;">
&nbsp;&nbsp;&nbsp;&nbsp; &lt;/entry&gt;<br>
&lt;/feed&gt;<br>
</div>
<span style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span></div>
<p>Let's assume that the two "updates" worked, but one of the two
deletions failed. In this case, the batch status feed might look like
the following. Note that the Entries are returned in exactly the same
order that they appear in the Batch Request.<br>
</p>
<div style="margin-left: 40px;"><br>
<div id="codebox">&lt;feed xmlns="http://www.w3.org/2005/Atom" <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
xmlns:asbatch="http://atomserver.org/namespaces/1.0/batch"&gt;<br>
&nbsp;<span style="font-weight: bold;">&nbsp; &nbsp;
&lt;asbatch:results inserts="0" updates="2" deletes="1" errors="1"
/&gt;&nbsp;&nbsp;&nbsp; </span><br style="font-weight: bold;">
&nbsp;&nbsp;&nbsp;&nbsp; &lt;entry
xmlns:ha="http://atomserver.org/namespaces/atomserver/1.0/"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;id&gt;/myserver/v1/widgets/acme/<span style="font-weight: bold;">92347</span>.en.xml&lt;/id&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;updated&gt;2007-11-15T17:09:19.000Z&lt;/updated&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;published&gt;2007-11-15T17:09:19.000Z&lt;/published&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;title
type="text"&gt;Entry: acme 92347.en&lt;/title&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;author&gt;&lt;name&gt;AtomServer APP
Service&lt;/name&gt;&lt;/author&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;link
href="/myserver/v1/widgets/acme/92347.en.xml" rel="self"/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;link
href="/myserver/v1/widgets/acme/92347.en.xml/2" rel="edit"/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;content
type="application/xml"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property xmlns="http://schemas.atomserver.org/widgets/v1/rev0"
systemId="acme"
id="92347" inNetwork="false"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;contact&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&lt;contactId&gt;1638&lt;/contactId&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&lt;displayName&gt;Chris Berry&lt;/displayName&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&lt;hasEmail&gt;true&lt;/hasEmail&gt;<br>
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/contact&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/property&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/content&gt;<br>
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;asbatch:operation
type="update"/&gt;</span><br style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;asbatch:status
code="200" reason="OK"/&gt;</span><br style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;</span>&nbsp;&nbsp;&nbsp;
&lt;/entry&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;entry
xmlns:ha="http://atomserver.org/namespaces/atomserver/1.0/"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;id&gt;/myserver/v1/widgets/acme/<span style="font-weight: bold;">92345</span>.en.xml&lt;/id&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;updated&gt;2007-11-15T17:09:19.000Z&lt;/updated&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;published&gt;2007-11-15T17:10:19.000Z&lt;/published&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;title
type="text"&gt;Entry: acme 92345.en&lt;/title&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;author&gt;&lt;name&gt;AtomServer APP
Service&lt;/name&gt;&lt;/author&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;link
href="/myserver/v1/widgets/acme/92345.en.xml" rel="self"/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;link
href="/myserver/v1/widgets/acme/92345.en.xml/2" rel="edit"/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;content
type="application/xml"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;deletion xmlns="http://schemas.atomserver.org/myserver/v1/rev0"
collection="acme" id="92345" locale="en"<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
workspace="widgets"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property xmlns="http://schemas.atomserver.org/widgets/v1/rev0"
systemId="acme"
id="92345" inNetwork="false"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
&nbsp; &nbsp;&nbsp; &lt;contact&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;&nbsp; &nbsp; &lt;contactId&gt;1533&lt;/contactId&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;&nbsp; &nbsp; &lt;displayName&gt;Alex Victoria&lt;/displayName&gt;<br>
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
&lt;/contact&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/property&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/deletion&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/content&gt;<br>
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;asbatch:operation
type="delete"/&gt;</span><br style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;asbatch:status
code="200" reason="OK"/&gt;</span><br style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;</span>&nbsp;&nbsp;&nbsp;
&lt;/entry&gt;&nbsp;
<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;entry&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;id&gt;/atomserver/v1/widgets/acme/<span style="font-weight: bold;">23456</span>.en.xml&lt;/id&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;title
type="text"&gt; Entry: acme 23456.en&lt;/title&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;author&gt;&lt;name&gt;AtomServer APP
Service&lt;/name&gt;&lt;/author&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;link
href="/atomserver/v1/widgets/acme/23456.en.xml" rel="self" /&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;link
href="/atomserver/v1/widgets/acme/23456.en.xml/2" rel="edit" /&gt;<br>
&nbsp;<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;asbatch:operation type="delete" /&gt;</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;asbatch:status code="404" reason="Unknown Entry::
/atomserver/v1/widgets/acme/$batch&amp;#xa;Reason:: Entry [widgets,
acme, 23456, en] NOT FOUND" /&gt;</span><br style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;</span>&nbsp;&nbsp;&nbsp;
&lt;/entry&gt;<br>
&nbsp; &nbsp;&nbsp; &lt;entry
xmlns:ha="http://atomserver.org/namespaces/atomserver/1.0/"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;id&gt;/myserver/v1/widgets/acme/<span style="font-weight: bold;">92348</span>.en.xml&lt;/id&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;updated&gt;2007-11-15T17:09:19.000Z&lt;/updated&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;published&gt;2007-11-15T17:11:19.000Z&lt;/published&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;title
type="text"&gt;Entry: acme 92348.en&lt;/title&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;author&gt;&lt;name&gt;AtomServer APP
Service&lt;/name&gt;&lt;/author&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;link
href="/myserver/v1/widgets/acme/92348.en.xml" rel="self"/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;link
href="/myserver/v1/widgets/acme/92348.en.xml/1" rel="edit"/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;content
type="application/xml"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property xmlns="http://schemas.atomserver.org/widgets/v1/rev0"
systemId="acme"
id="92348" inNetwork="false"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;contact&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&lt;contactId&gt;1533&lt;/contactId&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&lt;displayName&gt;Bryon Jacob&lt;/displayName&gt;<br>
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/contact&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/property&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/content&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;category/&gt;<br>
&nbsp;<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;asbatch:operation
type="insert"/&gt;</span><br style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;asbatch:status
code="200" reason="OK"/&gt;</span><br style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;</span>&nbsp;&nbsp;&nbsp;
&lt;/entry&gt;<br>
&lt;/feed&gt;<font size="2"><br>
</font> </div>
<span style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span></div>
<div style="margin-left: 40px;"><span style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span><span
 style="font-family: monospace;"></span></div>
<br>
<hr style="width: 100%; height: 2px;">
<h2><a name="resources"></a>Additional resources</h2>
You may find the following third-party documents useful:<br>
<br>
&nbsp;&nbsp;&nbsp; * <a
 href="http://www-128.ibm.com/developerworks/xml/library/x-atom10.html">Overview
of Atom</a> from IBM<br>
&nbsp;&nbsp;&nbsp; * <a
 href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html">HTTP 1.1
method definitions</a>; specification for GET, POST, PUT, and DELETE<br>
&nbsp;&nbsp;&nbsp; * <a
 href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html">HTTP 1.1
status code definitions</a><br>
&nbsp;&nbsp;&nbsp; * <a
 href="http://www.atomenabled.org/developers/syndication/">Atom
Syndication Reference</a> (from Atom-enabled)<br>
&nbsp;&nbsp;&nbsp; * <a
 href="http://www-128.ibm.com/developerworks/library/x-atompp1/">Getting
to know the Atom Publishing Protocol (from IBM)</a><span
 style="font-weight: bold;"></span><br>
<br>
</div>
</body>
</html>
